package cn.liujianbo.example.mystarter.service;

import lombok.Data;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 刘建波
 * @date 2021-01-16 10:42
 */
@Service
@Data
public class UserService implements BeanNameAware {
    @Autowired
    @Qualifier("demo1")
    Demo demo1;

    @Resource
    Demo demo;

    String beanName;

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }
}
